﻿using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Collections.Generic;

namespace ACSTools.DataContracts
{
    [JsonObject("device-action")]
    public class DeviceAction
    {
        public DeviceAction()
        { }

        [JsonProperty("solicitableStatus")]
        public string solicitableStatus { get; set; }

        [JsonProperty("revision")]
        public string revision { get; set; }

        [JsonProperty("solicit")]
        public bool solicit { get; set; }

        [JsonObject]
        public class script
        {
            [JsonProperty("queuedRunId")]
            public string queuedRunId { get; set; }

            [JsonProperty("scriptCode")]
            public string scriptCode { get; set; }

            [JsonProperty("scriptActorType")]
            public string scriptActorType { get; set; }

            [JsonProperty("scriptActorName")]
            public string scriptActorName { get; set; }

            [JsonProperty("status")]
            public string status { get; set; }

            [JsonObject]
            public class parameter
            {
                [JsonProperty("name")]
                public string name { get; set; }

                [JsonProperty("value")]
                public string value { get; set; }
            }

            [JsonProperty("parameters")]
            public IList<parameter> parameters { get; set; }
        }

        [JsonProperty("scripts")]
        public IList<script> scripts { get; set; }

        [JsonObject]
        public class application
        {
            public application() { }

            [JsonProperty("pendingSync")]
            public bool pendingSync { get; set; }

            [JsonProperty("dataOwner")]
            public string dataOwner { get; set; }

            [JsonProperty("needsInitialization")]
            public bool needsInitialization { get; set; }
        }

        [JsonProperty("applications")]
        public Dictionary<string, application> applications { get; set; }

        [JsonObject]
        public class service
        {
            public service() { }

            [JsonProperty("canToggleStatus")]
            public bool canToggleStatus { get; set; }

            [JsonProperty("status")]
            public string status { get; set; }
        }

        [JsonProperty("services")]
        public Dictionary<string, service> services { get; set; }
    }
}
